import { post } from "@/http";

export type LoginParams = {
  username: string;
  password: string;
};

export type LoginResponse = {
  username: string;
  roles: string[];
  accessToken: string;
  refreshToken: string;
};

export function userLogin(params?: LoginParams) {
  return post<LoginResponse>({}, "/login", params);
}
